#include "stdafx.h"
#include "ZegoDeviceManager.h"
#include "zego-api-defines.h"
#include "LiveRoom.h"

using namespace ZEGO;

CZegoDeviceManager::CZegoDeviceManager()
{
}


CZegoDeviceManager::~CZegoDeviceManager()
{
}


void CZegoDeviceManager::EnumAllDevice()
{
	AV::DeviceInfo* pDeviceList(NULL);
	int nDeviceCount(0);
	pDeviceList = LIVEROOM::GetAudioDeviceList(ZEGO::AV::AudioDevice_Input, nDeviceCount);

	if (nDeviceCount > 0 && pDeviceList != NULL) {
		for (int i = 0; i < nDeviceCount; i++) {
			mics.push_back(pDeviceList[i].szDeviceId);
		}
	}

	LIVEROOM::FreeDeviceList(pDeviceList);
	pDeviceList = NULL;

	pDeviceList = LIVEROOM::GetVideoDeviceList(nDeviceCount);
	if (nDeviceCount > 0 && pDeviceList != NULL) {
		for (int i = 0; i < nDeviceCount; i++) {
			cameras.push_back(pDeviceList[i].szDeviceId);
		}
	}
	LIVEROOM::FreeDeviceList(pDeviceList);
	pDeviceList = NULL;
}